<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
  <head>
 <title>商品管理表</title>
   
	<meta http-equiv="pragma" content="艺博客，装点生活">
	<meta http-equiv="cache-control" content="艺博客为书画爱好者提供服务平台">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="${pageContext.request.contextPath}/manage/css/styleb.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/jqueryb.js"></script>
	
</head>
<body>
    <div class="rightinfo">  
    <div class="rightform">
    <form action="admin/Hproduct" method="post">
   查询的商品名:&nbsp;&nbsp;<input type="text" name="product" style="border:1px solid ;border-color:#0066CC">
    查询的作者名:&nbsp;&nbsp;<input type="text" name="author"style="border:1px solid ;border-color:#0066CC">
    价格:&nbsp;&nbsp;<input type="text" name="maxmoney"style="border:1px solid ;border-color:#0066CC">
      -- <input type="text" name="lowmoney"style="border:1px solid ;border-color:#0066CC">
       <input type="submit" name="查询"style="border:1px solid ;border-color:#0066CC">   
       </form>
       
    </div>
    <br>
    <hr style="height:1px;border:none;border-top:1px dashed #0066CC;" />
    <table class="tablelist">
    	<thead>
	 	    <tr >
			      <th style="width:30px"><input name="" type="checkbox" value="" checked="checked"/></th>
			      <th style="width:30px">id</th>
			      <th style="width:80px">商品名</th>
			      <th style="width:35px">作者</th>
			    
			      <th style="width:35px">价格</th>
			      <th style="width:35px">数量</th>
				  <th style="width:35px">商品图</th>
			
				  <th style="width:40px">类型</th>
				  <th style="width:40px">主题</th>
				  <th style="width:40px">适用场所</th>
				  <th style="width:60px">尺寸</th>
				  <th style="width:60px">上架时间</th>
				  <th style="width:60px">下架时间</th>
				  <th style="width:35px">出售</th>
				  <th style="width:35px">标记</th>
				  <th colspan="3" style="width:110px">对商品的操作</th>
	      </tr>
        </thead>
        <tbody>
        <c:forEach items="${listProduct}" var="i">
        <tr>
        <td><input name="${i.p_id}" type="checkbox" value="${i.p_id }" /></td>
        <td>${i. p_id}</td>
        <td>${i.p_name }</td>
        <td>${i. p_author}</td>
		
        <td>${i.p_price }</td>
        <td>${i.p_count }</td>
       	<td><img src="${i. p_image}" width="40" height="40"></td> 
        <td>${i.art_type }</td>
        <td>${i. t_type}</td>
        <td>${i. occations}</td>
        <td>${i.p_size }</td>
     	<td>${i.shelf_time }</td>
        <td>${i.down_time }</td>
        <td>${i.p_sale }</td>
        <td>${i.p_flag }</td>       
        <td><a href="managehproduct.do?lookhProductID=${i.p_id}" class="tablelink">查看</a> </td>
       <!--soldOutID 下架商品的id -->

        <td><a href="managehproduct.do?soldOutID=${i.p_id}" onclick="return soldOutID()" class="tablelink"> 下架</a></td>
      
        <td><a href="hproductup.jsp?hproductupID=${i.p_id}" class="tablelink"> 修改</a></td>
        </tr> 
        </c:forEach>
        </tbody>
         </table>
	<script type="text/javascript">
	    function  soldOutID(){
	         if(confirm("您要确认下架吗？"))
	         return true;
	         else
	         return false;
	    }
	      
	</script>
   


    <div class="pagin">
    	<div class="message">共<i class="blue">${pbm.totalRecord}</i>条记录，当前显示第&nbsp;<i class="blue">${pbm.pageNun}&nbsp;</i>页</div>
        <ul class="paginList">
        <!-- 如果当前有为第一页时，就没有上一页的超链接显示 -->
        <c:if test="${pbm.pageNun != 1 }">
            <li class="paginItem"><a href=" ${pageContext.request.contextPath}/admin/hproduct?pageNun=${pbm.pageNun - 1}"><span class="pagepre"> < </span></a></li>
        </c:if>

        <c:forEach begin="${pbm.start }" end="${pbm.end }"  step="1" var="i" >
           <%--   <c:if test="${pageProductMessage.pageNu == i}"> --%>
             <li class="paginItem"><a href=" ${pageContext.request.contextPath}/admin/hproduct?pageNun=${i}">${i}</a></li>
            <%--  </c:if> --%>
        </c:forEach>

         <c:if test="${pbm.pageNun !=  pbm.totalPage}">
             <li class="paginItem"><a href=" ${pageContext.request.contextPath}/admin/hproduct?pageNun=${pbm.pageNun+1} "><span class="pagenxt">></span></a></li>
        </c:if>
        </ul>


        <ul class="page_num">
            <c:if test="${pbm.pageNun !=1}">
                <li class="pre"><a href=" ${pageContext.request.contextPath}/webpage/artwork?pageNun=${pbm.pageNun - 1}">&lt;</a></li>
            </c:if>

            <c:forEach begin="${pbm.start +1}" end="${pbm.end }"  step="1" var="i" >

                <li class="" bs="${i}" >
                    <a href="artwork?pageNun=${i}">${i}</a>
                </li>

            </c:forEach>
            <c:if test="${pbm.pageNun !=  pbm.totalPage}">
                <li class="next"><a href=" ${pageContext.request.contextPath}/webpage/artwork?pageNun=${pbm.pageNun + 1} ">&gt;</a></li>
            </c:if>
        </ul>
    </div>
    </div>
    </form>
    </div>
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>